﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Net;
using System.IO;

namespace BusinessLogic
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "SMSWCF" in code, svc and config file together.
    public class SMSWCF : ISMSWCF
    {
        public void sendSMS(string mobile)
        {
            WebClient client = new WebClient();

            client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
            client.QueryString.Add("user", "markmari");
            client.QueryString.Add("Password", "gDIKCXdXgTcfgD");
            client.QueryString.Add("api_id", "3477042");
            client.QueryString.Add("to", mobile);
            client.QueryString.Add("text", "Your product status has been updated. Please log into the website to check");
            string baseurl = "http://api.clickatell.com/http/sendmsg";
            Stream data = client.OpenRead(baseurl);
            StreamReader reader = new StreamReader(data);
            string s = reader.ReadToEnd();
            data.Close();
            reader.Close();


        }
    }
}
